
<%@ page import="report.Activity" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title>iPET - Atividades</title>
    </head>
    <body>
        <g:render template="/common/menuActivity" />
        <div id="text">
        <div class="body">
            <h2>Selecione as atividades</h2>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
				<table>
                    <thead>
                        <tr>
                        	<th class="leftth actions">Ações</th>
                            <g:sortableColumn property="theme" title="${message(code: 'activity.theme.label', default: 'Tema')}" />
                            <g:sortableColumn class="rightth" property="nature" title="${message(code: 'activity.nature.label', default: 'Natureza')}" />
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${activityInstanceList}" status="i" var="activityInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                            <td>
                            	<input class="left" type="checkbox" name="activities" value="${activityInstance.id}" />
                            	<div class="actions">
            						<g:link action="show" controller="activity" id="${activityInstance.id}" title="Visualizar"><img alt="Edit" src="${resource(dir:'images/icons',file:'view.png')}" /></g:link>
								</div>
                            </td>
                            <td>${fieldValue(bean: activityInstance, field: "theme")}</td>
                            <td>${fieldValue(bean: activityInstance, field: "nature")}</td>
                        </tr>
                    </g:each>
                    </tbody>
				</table>
            </div>
	        <div class="buttons">
				<span class="button"><input type="submit" value="Gerar" class="report" onclick="var f = document.createElement('form'); f.style.display = 'none'; f.method = 'POST'; f.action = '/iPET/pdf/activities'; var c = document.getElementsByName('activities'); for (var i = 0; i < c.length; i++) if (c[i].checked) f.appendChild(c[i].cloneNode(false)); f.submit(); return false;" /></span>
	        </div>
        </div>
        </div>
    </body>
</html>
